Skip to content

feat: add RuntimeStats TypeScript interface to embed addon#969

Merged
gianni-cor merged 2 commits into
tetherto:mainfrom
donriddo:feat/embed-runtime-stats-type
Mar 18, 2026
Merged

feat: add RuntimeStats TypeScript interface to embed addon#969
gianni-cor merged 2 commits into
tetherto:mainfrom
donriddo:feat/embed-runtime-stats-type

Conversation

@donriddo

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

How does it solve it?

  • Adds a RuntimeStats interface to index.d.ts with all 5 keys returned by the C++ addon: total_tokens, total_time_ms, tokens_per_second, batch_size, context_size.
  • Bumps version to 0.12.1 with changelog entry.

API Changes

import { RuntimeStats } from '@qvac/embed-llamacpp'

// Stats object shape returned by the C++ addon
const stats: RuntimeStats = {
  total_tokens: 128,
  total_time_ms: 45.2,
  tokens_per_second: 2831.9,
  batch_size: 512,
  context_size: 8192
}

@donriddo donriddo requested review from a team as code owners March 18, 2026 12:22
@gianni-cor

Copy link
Copy Markdown
Contributor

/review

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Tier-based Approval Status

**PR Tier:** TIER1

**Current Status:** ✅ APPROVED

**Requirements:**
- 1 Team Member approval ✅ (1/1)
- 1 Team Lead OR Management approval ✅ (1/1)



---
*This comment is automatically updated when reviews change.*

Add RuntimeStats type to index.d.ts covering all stats keys
returned by the C++ BertModel::runtimeStats(): total_tokens,
total_time_ms, tokens_per_second, batch_size, context_size.

Bump version to 0.12.1.
The C++ BertModel::runtimeStats() only emits tokens_per_second
when t_p_eval_ms > 0. Mark the field optional to match the
actual runtime payload shape.
@gianni-cor gianni-cor force-pushed the feat/embed-runtime-stats-type branch from 788c0b6 to bdf4004 Compare March 18, 2026 12:43
@gianni-cor

Copy link
Copy Markdown
Contributor

/review

@gianni-cor gianni-cor merged commit 2452a7b into tetherto:main Mar 18, 2026
18 checks passed
Proletter pushed a commit that referenced this pull request May 24, 2026
* feat: add RuntimeStats TypeScript interface to embed addon

Add RuntimeStats type to index.d.ts covering all stats keys
returned by the C++ BertModel::runtimeStats(): total_tokens,
total_time_ms, tokens_per_second, batch_size, context_size.

Bump version to 0.12.1.

* fix: make tokens_per_second optional in RuntimeStats

The C++ BertModel::runtimeStats() only emits tokens_per_second
when t_p_eval_ms > 0. Mark the field optional to match the
actual runtime payload shape.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants